package com.github.xiaolyuh.enums;

public enum LocalCacheInstanceEnum {
    NORMAL_COUPON(1,"普通coupon信息缓存实例"),SYSTEM_COUPON(2,"系统coupon信息缓存实例"),
    ACTIVITY_BASE_AND_PRIORITY(3,"活动基本信息缓存实例"),ACTIVITY_INDEX(4,"活动索引信息缓存实例"),;
    private Integer code;
    private String desc;

    LocalCacheInstanceEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public Integer getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public static LocalCacheInstanceEnum valueOf(Integer code){
        LocalCacheInstanceEnum[] instanceEnums=LocalCacheInstanceEnum.values();
        for (LocalCacheInstanceEnum instanceEnum:instanceEnums){
            if(instanceEnum.getCode().equals(code)){
                return instanceEnum;
            }
        }
        return null;
    }
}